package www.nomina.model.dao;

import java.io.File;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;

import www.nomina.controller.bean.sat.Comprobante;



public class XmlDAO extends Comprobante {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	Comprobante nomi = new Comprobante();

	public void crear(Comprobante nomi)throws JAXBException{
		try {		
			
			File file = new File("/home/nastick/Documentos/nomina.xml");
			//escribir = new FileWriter("/home/nastick/Documentos/nomina.xml");
			JAXBContext context = JAXBContext.newInstance(Comprobante.class);
			System.out.println("Siiii");
			Marshaller m = context.createMarshaller();
			System.out.println("Siii2");
			m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
			System.out.println("wwwwww");
			m.marshal(nomi, file);
			m.marshal(nomi, System.out);
			
			

		} catch (JAXBException e) {
			e.printStackTrace();
		}

	}
		
	
	public static void main(String[] args){

		//Comprobante nomi = new Comprobante();
		//nomi.getDatosTimbre().setSelloCFD("selloCFD");
		
		
	}
}
